#!/bin/bash
killall synergys

cp client.txt oldclient.txt
cp server.txt oldserver.txt

java SynergyServer

client=$(cat client.txt)
server=$(cat server.txt)
oldclient=$(cat oldclient.txt)
oldserver=$(cat oldserver.txt)

sed -i "s/$oldclient/$client/g" ./synergy.conf
sed -i "s/$oldserver/$server/g" ./synergy.conf

synergys -f --config ./synergy.conf
